//
//  SISSCooperationContractShowViewController.m
//  SISSAPP
//
//  Created by 袁应荣 on 2019/7/9.
//  Copyright © 2019 优房网. All rights reserved.
//

#import "SISSCooperationContractShowViewController.h"
#import "SISSUploadCooperationContractViewController.h"
#import "SISSNetworkingManager+CoopProgress.h"

@interface SISSCooperationContractShowViewController ()

///
@property (strong, nonatomic) SISSCooperationAgreementModel *cooperationContractModel;

@end

@implementation SISSCooperationContractShowViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"二手房交易合作协议";
    [self requestCooperationContractData];
}

- (void)setCooperationContractModel:(SISSCooperationAgreementModel *)cooperationContractModel {
    _cooperationContractModel = cooperationContractModel;
    self.contractNoView.rightStr = cooperationContractModel.contractNum;
    self.contractEndDateView.rightStr = [NSDate yyr_stringToString:cooperationContractModel.endTime];
    self.remarkView.rightStr = cooperationContractModel.otherdesc;
    self.createDateView.rightStr = cooperationContractModel.insertTime;
    self.uploadImageShowView.imageUrlArr = cooperationContractModel.image.mutableCopy;
}


- (void)requestCooperationContractData {
    WeakSelf
    [kNetworkManager requestCooperationProgressCooperationAgreementWithAbpId:self.abpId success:^(SISSCooperationAgreementModel *agreementModel) {
        weakSelf.cooperationContractModel = agreementModel;
    } failed:^(NSError *error) {
        NSLog(@"%@",error);
    }];
    
}

- (void)modifyButtonClickAction {
    SISSUploadCooperationContractViewController *vc = [[SISSUploadCooperationContractViewController alloc] init];
    vc.abpId = self.abpId;
    vc.cooperationContractModel = self.cooperationContractModel;
    vc.isHouseCooperatonIn = self.isHouseCooperatonIn;
    [self.navigationController pushViewController:vc animated:YES];
}

@end
